<script src="jquery-1.8.2.min.js" type="text/javascript"></script><script type="text/javascript">    $(document).ready(function(){    // By Class    $('#clickId').click(function(){                $('#linkId').html('Facebook.com');// set Value      alert($('#linkId').attr('id'))// get attribute Id of a tag      $('#linkId').attr('href','http://facebook.com');// set Value               });      });  </script><p>  <a href="#" id="clickId">click me</a></p><p>  <a href="http://google.com" id="linkId">google.com</a></p>